﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using TweetSharp.Twitter.Model;

namespace Halfwit.Converters
{
    class IsMineConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            var tweet = value as TwitterStatus;
            if (tweet == null) return false;

            return tweet.User != null && tweet.User.Id == TwitterConnection.UserId;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
